package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.service.PurchaseListServicr;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@Controller
@RequestMapping("/purchaseListGoods")
public class PurchaseListGoodsController {

    @Autowired
    private PurchaseListServicr purchaseListServicr;

  //localhost:8080/purchaseListGoods/save?purchaseNumber=JH1605768306735
    // （进货单号前端生成）
    //进货单保存
    @PostMapping("/save/{purchaseNumber}")
    public ServiceVO stockSave(@PathVariable String purchaseNumber){
       return purchaseListServicr.save(purchaseNumber);
    }













//    进货单列表展示（可条件查询：单据号模糊、供应商、是否付款和日期区间）
    //localhost:8080/purchaseListGoods/list
    @PostMapping("list")
    public Map<String,Object> ListSave(){
        return purchaseListServicr.ListSave();
    }


}
